package com.gui.registration.controller;

import com.gui.entity.R;
import com.gui.hospital.model.Doctor;
import com.gui.hospital.model.Hospital;
import com.gui.hospital.openfeign.HospitalFeign;
import com.gui.registration.service.RegistrationService;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * Author:刘舒佳
 * Date:2024/8/22
 */
@RestController
@AllArgsConstructor
@RequestMapping("/registration")
@CrossOrigin
public class RegistrationController {
    private final RegistrationService registrationService;
//
//    @GetMapping("hospitalList/{currentPage}/{pageSize}")
//    public R getHospitalList(@PathVariable Integer currentPage, @PathVariable Integer pageSize, @RequestBody Hospital hospital){
//        return hospitalFeign.getHospitalList(currentPage,pageSize,hospital);
//    }
//    @GetMapping
//    public R getHospital(){
//        return new R(hospitalFeign.getHospital());
//    }

    @GetMapping("getHospitalList")
    public R getHospitalList(@RequestParam(value="name",required = false) String name){
        List<Hospital> list=registrationService.getHospitalList(name);
        System.out.println(list);
        return new R(list);
    }


}
